﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Swimj.Core.Providers;
using Swimj.Core.Securities;

namespace Admin.ApplicationLib;

public class AdminApplicationDesignFactory : IDesignTimeDbContextFactory<AdminApplicationDbContext>
{
    public AdminApplicationDbContext CreateDbContext(string[] args)
    {
        var dbContextOptionsBuilder = new DbContextOptionsBuilder<AdminApplicationDbContext>()
            .UseSqlServer("Server=127.0.0.1,5433;Initial Catalog=youAdminDB;User Id=sa;Password=Pass@word;Encrypt=false");
        return new AdminApplicationDbContext(dbContextOptionsBuilder.Options,
            new CurrentUser(), new LocalDataTimeProvider());
    }
}